package edu.java.lectures.lec09.exceptions.throwing;

public class ExceptionPropagationExample {

    public static void main(String[] args) {
	// throws Exception { --> syntactically possible but semanticaly NOT
	// DESIRED
	try {
	    doSomething5();
	} catch (Exception e) {
	    e.printStackTrace();
	}
    }

    public static void doSomething5() throws Exception {
	doSomething4();
    }

    public static void doSomething4() throws Exception {
	doSomething3();
    }

    public static void doSomething3() throws Exception {
	doSomething2();
    }

    public static void doSomething2() throws Exception {
	doSomething1();
    }

    public static void doSomething1() throws Exception {
	throw new Exception("Exceptional event in doSomething1().");
    }

}
